import request from './axiosConfig'

// 接口参数类型
interface LoginParams {
  username: string
  password: string
}

interface RegisterParams {
  username: string
  password: string
  email: string
  isAdmin: number
}

// 用户登录
export const login = (data: LoginParams) => {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

// 用户注册 - 添加管理员用户
export const register = (data: RegisterParams) => {
  return request({
    url: '/users',
    method: 'post',
    data
  })
} 